#include "common.h"

#ifndef __MUTEX__
#define __MUTEX__

namespace GXL_Engine
{
	class Mutex
	{
	public:
		Mutex()
		{
			m_Mutex = CreateMutex (NULL, FALSE, NULL);
		}
		~Mutex()
		{
			CloseHandle(m_Mutex);
		}
		VOID	Acquire()
		{
			WaitForSingleObject( m_Mutex, INFINITE );
		}
		VOID	Release()
		{
			ReleaseMutex( m_Mutex);
		}
	private:
		HANDLE    m_Mutex;
	};
}

#endif //__MUTEX__



